//
//  ZCFGCellModel.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/3.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "ZCFGCellModel.h"

@interface ZCFGCellModel ()

@property (nonatomic, readwrite, copy) NSString* title;
@property (nonatomic, readwrite, copy) NSString* tag;
@property (nonatomic, readwrite, copy) NSString* time;

@end

@implementation ZCFGCellModel

- (instancetype)initWithData:(id)data cellHeight:(CGFloat)cellHeight
{
    self = [super init];
    if (self)
    {
        _data = data;
        
        /// cellHeight+2（2容错）
        _cellHeight = MHUIScaleValue(cellHeight)+2;
        
        @weakify(self);
        [[RACObserve(self, data) distinctUntilChanged] subscribeNext:^(id x)
         {
             @strongify(self);
             
             ArticleListData* aListData = x;
             
             //TODO:缺失参数
             self.title = aListData.title;
             self.time = aListData.from;
             self.tag = @"0";
         }];
    }
    
    return self;
}

@end
